#include<iostream>
#include<vector>
#include<map>
#include<tuple>
#include<iterator>
#include<algorithm>
#include<string>
#include<typeinfo>

using namespace std;

namespace std {
template<typename TKey, typename TVal>
ostream& operator<<(ostream& os, const pair<TKey, TVal>& p){
    return os<<"("<<p.first <<", "<<p.second<<")";
}
}

int main(){
    vector<pair<int, string>> v {
        {1, "one"}, {2, "two"}, {3,"three"}, {4, "four"}
    };
    map<int, string> m;
    copy_n(begin(v), 3, inserter(m, begin(m)));
    auto shell_it(ostream_iterator<decltype(v)::value_type>{cout, "; "});
    copy(begin(m), end(m), shell_it);
    cout<<endl;

    m.clear();
    move(begin(v), end(v), inserter(m, begin(m)));
    copy(begin(m), end(m), shell_it);
    cout<<endl;

    copy(begin(v), end(v), shell_it);
    cout<<endl;

    cout<<typeid(decltype(v)::value_type).name()<<endl;
    cout<<typeid(decltype(v[0])).name()<<endl;
    return 0;
}
